import request from "@/utils/request";

export function loginU(username, password) {
    return request({
        url: "user/login",
        method: "post",
        data: {
            username,
            password
        }
    });
}

export function loginA(username, password) {
    return request({
        url: "admin/login",
        method: "post",
        data: {
            username,
            password
        }
    });
}

export function getUserInfo() {
    return request({
        url: `/user/info`,
        method: "get"
    });
}

export function getAdminInfo() {
    return request({
        url: `/administrator/info`,
        method: "get"
    });
}

export function logout(command) {
    return request({
        url: `/user/logout`,
        method: "post",
        data: {
            command
        }
    });
}